<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <!-- MOTW-DISABLED saved from url=(0014)about:internet -->
    <title>Display credit limit ranges in the group header</title>
    <link rel="StyleSheet" href="css/grouping.css" type="text/css" media="all" />
    <link rel="StyleSheet" href="css/webworks.css" type="text/css" media="all" />
    <link rel="StyleSheet" href="webworks.css" type="text/css" media="all" />
    <script type="text/javascript" language="JavaScript1.2">
      <!--
        var  WebWorksRootPath = "";
      // -->
    </script>
  </head>
  <body>
    <div style="text-align: left;">
      <table cellspacing="0" summary="">
        <tr>
          <td>
            <a href="sg-TutT5GroupCustomerDataByCreditLimit.html"><img src="images/prev.gif" alt="Previous" border="0" /></a>
          </td>
          <td>
            <a href="sg-DisplayTheTotalNumberOfCustomersInTheReport.html"><img src="images/next.gif" alt="Next" border="0" /></a>
          </td>
        </tr>
      </table>
    </div>
    <hr align="left" />
    <blockquote>
      <h3 class="N_TutorialTask">Task 6:&nbsp;&nbsp;<a name="200953">Display credit limit ranges in the group header</a></h3>
      <p class="b_Body"><a name="192273">Rather than display the first value of each group in the group header, the report is easier to navigate if it displays the credit limit range for each group, as follows:</a></p>
      <div class="cf_CodeFirst"><a name="192274">0 - 49999</a></div>
      <div class="co_Code"><a name="192275">50000 - 99999</a></div>
      <div class="co_Code"><a name="192276">100000 - 149999</a></div>
      <p class="b_Body"><a name="249162">This procedure shows how to write a JavaScript expression to display these credit limit ranges. The procedure also shows how to create a column binding with which to associate the JavaScript expression.</a></p>
      <div class="N_n1_NumList1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n1_NumList1_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <span class="zAuto_0023Format">1&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n1_NumList1_inner"><a name="249163">Choose Layout to return to the layout editor.</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="N_n1_NumList1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n1_NumList1_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <span class="zAuto_0023Format">2&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n1_NumList1_inner"><a name="249164">Delete the [CREDITLIMIT] data element in the group header.</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="N_n1_NumList1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n1_NumList1_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <span class="zAuto_0023Format">3&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n1_NumList1_inner"><a name="374145">Insert a new data element in its place by right-clicking the cell and choosing Insert</a><span class="Dingbat">&rarr;</span>Data. New Data Binding prompts you to create a column binding for the new data element.</div>
            </td>
          </tr>
        </table>
      </div>
      <div class="N_n1_NumList1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n1_NumList1_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <span class="zAuto_0023Format">4&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n1_NumList1_inner"><a name="374147">Specify a name and expression for the column binding. Use the default data type, String.</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="N_n2_NumList2_outer" style="margin-left: 14.1732283464567pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n2_NumList2_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <span class="zAuto_0023FormatGray">1&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n2_NumList2_inner"><a name="209405">In Column Binding Name, type the following name:</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="cfi2_CodeFirstIndent2"><a name="256228">CREDIT_GRP_HEADER</a></div>
      <p class="N_si_ScanIcon"><a name="209409"><img class="Default" src="images/expressionbldrbutton.png" style="display: inline; float: none; left: 0.0; top: 0.0" alt="Expression Builder button" /></a></p>
      <div class="N_n2_NumList2_outer" style="margin-left: 14.1732283464567pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n2_NumList2_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <span class="zAuto_0023FormatGray">2&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n2_NumList2_inner"><a name="256235">Open the expression builder to write a JavaScript expression.</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="N_n2_NumList2_outer" style="margin-left: 14.1732283464567pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n2_NumList2_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <span class="zAuto_0023FormatGray">3&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n2_NumList2_inner"><a name="256232">In the expression builder, type the following expression:</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="cfi_CodeFirstIndent"><a name="192285">&nbsp;&nbsp;for(i=50000; i&lt;300000; i+=50000){</a></div>
      <div class="coi2_CodeIndent2"><a name="192286">&nbsp;&nbsp;if( row["CREDITLIMIT"] &lt; i ){</a></div>
      <div class="coi2_CodeIndent2"><a name="192287">&nbsp;&nbsp;&nbsp;&nbsp;rangeStart = i-50000;</a></div>
      <div class="coi2_CodeIndent2"><a name="192288">&nbsp;&nbsp;&nbsp;&nbsp;rangeEnd = i-1;</a></div>
      <div class="coi2_CodeIndent2"><a name="192289">&nbsp;&nbsp;&nbsp;&nbsp;break;</a></div>
      <div class="coi2_CodeIndent2"><a name="192290">&nbsp;&nbsp;}</a></div>
      <div class="coi_CodeIndent"><a name="192291">&nbsp;&nbsp;}</a></div>
      <div class="coi_CodeIndent"><a name="192292">&nbsp;&nbsp;displayString = rangeStart + " - " + rangeEnd;</a></div>
      <div class="N_i2_Indent2"><a name="192294">Choose OK. The expression appears in the Expression field on New Data Binding, as shown in </a><a href="#256258" title="Display credit limit ranges in the group header">Figure&nbsp;7-8</a>.</div>
      <p class="i3_Image3"><a name="256251"><img class="Default" src="images/grpt_colbinding.png" style="display: inline; float: none; left: 0.0; top: 0.0" alt="Figure 7-8 Column binding defined" /></a></p>
      <div class="fc3_FigCall3Title">
        <b class="Bold">Figure&nbsp;7-8&nbsp;&nbsp;</b><a name="256258">Column binding defined</a></div>
      <div class="N_n2_NumList2_outer" style="margin-left: 14.1732283464567pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n2_NumList2_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <span class="zAuto_0023FormatGray">4&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n2_NumList2_inner"><a name="256276">Choose OK to save the column binding for the data element. In the layout editor, the data element displays the column binding name, [CREDIT_GRP_HEADER].</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="N_n1_NumList1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n1_NumList1_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <span class="zAuto_0023Format">5&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n1_NumList1_inner"><a name="256282">Select the data element. In Property Editor, under Properties, in General, choose B to format the group heading as bold text.</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="N_n1_NumList1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n1_NumList1_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <span class="zAuto_0023Format">6&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n1_NumList1_inner"><a name="421252">Preview the report. The group headers display the credit limit ranges. </a><a href="#421261" title="Display credit limit ranges in the group header">Figure&nbsp;7-9</a> shows the 50000 - 99999 group header.</div>
            </td>
          </tr>
        </table>
      </div>
      <p class="i2_Image2"><a name="421259"><img class="Default" src="images/grpt_output3.png" style="display: inline; float: none; left: 0.0; top: 0.0" alt="Figure 7-9 Report preview showing credit limit ranges" /></a></p>
      <div class="fc2_FigCall2Title">
        <b class="Bold">Figure&nbsp;7-9&nbsp;&nbsp;</b><a name="421261">Report preview showing credit limit ranges</a></div>
    </blockquote>
    <hr align="left" />
    <table align="right" summary="">
      <tr>
        <td class="WebWorks_Company_Name_Bottom">
          <a href="notices.html">(c) Copyright Actuate Corporation 2013</a>
        </td>
      </tr>
    </table>
  </body>
</html>